home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / projLightUI.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.7 KB  |  155 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // $RCSfile: projLightUI.mel $
  19. //
  20. // $Source: /vobs/aw/Maya/src/RenderUISlice/UI/projectLight/projLightUI.mel $
  21. //
  22. // $Locker:$
  23. //
  24. // $Author: ghooper $
  25. // $Revision: /main/6 $
  26. // $Date: 1997/12/08 21:54:23 $
  27. //
  28. // Class:               projLightUI
  29. //
  30. // Original Author:        Sanjay Bakshi
  31. //
  32. // Description:
  33. //        Create the UI for the projectLightEditor.  This should
  34. //        be called from projectLightPanel.
  35. //
  36.  
  37.  
  38.  
  39. global proc projLightUI(string $projLightEditor) 
  40. {
  41. //    string $windowName = $projLightEditor + "UI";
  42. //    window $windowName;
  43.  
  44.     setUITemplate -pushTemplate DefaultTemplate;    
  45.     columnLayout b;
  46.  
  47.     button -l "light" -c 
  48.         ("projectLightEditor -e -light `ls -selection`" + $projLightEditor) lightButton;
  49. //    button -l "blockers" -c 
  50. //        ("projectLightEditor -e -blockers `ls -selection`" + $projLightEditor) blockersButton;
  51.  
  52.     button -l "blockers" -c ("findGeomForLightProj -blockers " + $projLightEditor) blockersButton;
  53.  
  54.     button -l "receivers" -c ("findGeomForLightProj -receivers " + $projLightEditor) receiversButton;
  55.  
  56.     checkBox -l "shadow contours" -cc
  57.         ("projectLightEditor -e -shadowContours #1 " + $projLightEditor)
  58.     shadowContourBox;
  59.  
  60.     checkBox -l "shadow polygons" -cc
  61.         ("projectLightEditor -e -shadowPolygons #1 " + $projLightEditor)
  62.     shadowPolygonsBox;
  63.  
  64.     checkBox -l "illumReg contours" -cc
  65.         ("projectLightEditor -e -illumRegContours #1 " + $projLightEditor)
  66.     illumRegContoursBox;
  67.  
  68.     checkBox -l "illumReg polygons" -cc
  69.         ("projectLightEditor -e -illumRegPolygons #1 " + $projLightEditor)
  70.     illumRegPolygonsBox;
  71.  
  72.     checkBox -l "illumReg texture" -cc
  73.         ("projectLightEditor -e -illumRegTexture #1 " + $projLightEditor)
  74.     illumRegTextureBox;
  75.  
  76.     intSliderGrp -l "resolution" -min 10 -max 1000 -v 100 -field true -cc
  77.         ("projectLightEditor -e -resolution #1 " + $projLightEditor)
  78.     resolutionGrp;
  79.  
  80.     intSliderGrp -l "subdivisions" -min 1 -max 20 -v 4 -field true -cc
  81.         ("projectLightEditor -e -subdivisions #1 " + $projLightEditor)
  82.     subdivisionsGrp;
  83.  
  84.     checkBox -l "continuous update" 
  85.         -onCommand ("projectLightEditor -e -continuousUpdate 1 " + $projLightEditor)
  86.         -offCommand ("projectLightEditor -e -continuousUpdate 0 " + $projLightEditor)
  87.     continuousUpdateBox;
  88.  
  89.     checkBox -l "idle event update" 
  90.         -onCommand ("projectLightEditor -e -idleEventUpdate 1 " + $projLightEditor)
  91.         -offCommand ("projectLightEditor -e -idleEventUpdate 0 " + $projLightEditor)
  92.     idleEventUpdateBox;
  93.  
  94.     button -l "reset" -c 
  95.         ("projectLightEditor -e -reset " + $projLightEditor + "; projLightUIupdate " + $projLightEditor) resetButton;
  96.  
  97.     projLightUIupdate($projLightEditor);
  98.  
  99.     setUITemplate -popTemplate;
  100.  
  101. };
  102.  
  103. global proc projLightUIupdate(string $projLightEditor)
  104. {
  105.     checkBox -e -v 
  106.         `projectLightEditor -q -shadowContours $projLightEditor`
  107.     shadowContourBox;
  108.  
  109.     checkBox -e -v 
  110.         `projectLightEditor -q -shadowPolygons $projLightEditor`
  111.     shadowPolygonsBox;
  112.  
  113.     checkBox -e -v 
  114.         `projectLightEditor -q -illumRegContours $projLightEditor`
  115.     illumRegContoursBox;
  116.  
  117.     checkBox -e -v 
  118.         `projectLightEditor -q -illumRegPolygons $projLightEditor`
  119.     illumRegPolygonsBox;
  120.  
  121.     checkBox -e -v 
  122.         `projectLightEditor -q -illumRegTexture $projLightEditor`
  123.     illumRegTextureBox;
  124.  
  125.     intSliderGrp -e -v 
  126.         `projectLightEditor -q -resolution $projLightEditor`
  127.     resolutionGrp;
  128.  
  129.     intSliderGrp -e -v 
  130.         `projectLightEditor -q -subdivisions $projLightEditor`
  131.     subdivisionsGrp;
  132.  
  133.     checkBox -e -v 
  134.         `projectLightEditor -q -continuousUpdate $projLightEditor`
  135.     continuousUpdateBox;
  136.  
  137.     checkBox -e -v 
  138.         `projectLightEditor -q -idleEventUpdate $projLightEditor`
  139.     idleEventUpdateBox;
  140. };
  141.  
  142. global proc findGeomForLightProj(string $flag, string $editorName)
  143. {
  144.     string $selList[] = `ls -selection`;
  145.  
  146.     string $command = "projectLightEditor -e ";
  147.  
  148.     for ($item in $selList) {
  149.         $command += ($flag + " " + $item + " ");
  150.     }
  151.  
  152.     $command += $editorName;
  153.     evalEcho $command;
  154. };
  155.